﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

/// <summary>
///TemplateListShow 的摘要说明
/// </summary>
public class TemplateListShow:IListColumns
{
	public TemplateListShow()
	{
		//
		//TODO: 在此处添加构造函数逻辑
		//
	}

    #region IListColumns 成员

    public System.Web.UI.WebControls.DataControlField GetListField(ConfigColumns col)
    {
        Page page = HttpContext.Current.Handler as Page;
        if (page != null)
        {
            TemplateField field = new TemplateField();
            field.HeaderText = col.ListShowName;
            field.ItemTemplate = page.LoadTemplate(col.ListShowTemplatePath);

            return field;
        }
        else
        {
            return (new TextListShow()).GetListField(col);
        }
    }

    #endregion
}
